

function onDeleteOrder(url, Id, cbo)
{
	var isOK = -1;
	
	if(!confirm('Are you sure you want to delete the otder with Id:' + Id))
	{
		return false;
	}
	
	new Ajax.Request(url, 
	{
	  method: 'post',
	  asynchronous: false,
	  parameters:'act=delorder&id=' + Id,
	  onSuccess: function(transport) 
  		{
			var response = transport.responseText || "";
				var pos=response.indexOf('<!');
				content=response.substring(0,pos);
			
			//alert(response);
			
			obj = content.evalJSON();

    		if(obj == null)
    		{
    			$('ajaxResponse1').innerHTML = 'Something wrong! Reponsed string is: ' + response;
    		}
    		
    		isOK = obj.code;
		
    		$('ajaxResponse1').update(obj.message);
		}
	});

	$('ajaxResponse1').style.display = 'inherit';
	Fat.fade_element('ajaxResponse1', null, 1500, null, null);

	if(isOK == 0){
		rowID = cbo + '-' + Id;
		Fat.fade_element(rowID, null, 1000, "#f22", null);
		setTimeout("$(rowID).remove()", 1000);
		
	}				
}

function onDeleteRegister(url, Id, cbo)
{
	var isOK = -1;
	
	if(!confirm('Are you sure you want to delete the Pre-Register with Id:' + Id))
	{
		return false;
	}
	
	new Ajax.Request(url, 
	{
	  method: 'post',
	  asynchronous: false,
	  parameters:'act=delregister&id=' + Id,
	  onSuccess: function(transport) 
  		{
			var response = transport.responseText || "";
				var pos=response.indexOf('<!');
				content=response.substring(0,pos);
			
			//alert(response);
			
			obj = content.evalJSON();

    		if(obj == null)
    		{
    			$('ajaxResponse1').innerHTML = 'Something wrong! Reponsed string is: ' + response;
    		}
    		
    		isOK = obj.code;
		
    		$('ajaxResponse1').update(obj.message);
		}
	});

	$('ajaxResponse1').style.display = 'inherit';
	Fat.fade_element('ajaxResponse1', null, 1500, null, null);

	if(isOK == 0){
		rowID = cbo + '-' + Id;
		Fat.fade_element(rowID, null, 1000, "#f22", null);
		setTimeout("$(rowID).remove()", 1000);
		
	}				
}
